#ifndef VOLUMETOOL_H
#define VOLUMETOOL_H

#include <QWidget>

namespace Ui {
class VolumeTool;
}

class VolumeTool : public QWidget
{
    Q_OBJECT

public:
    explicit VolumeTool(QWidget *parent = nullptr);
    ~VolumeTool();

private:
    //绘制三角事件
    virtual void paintEvent(QPaintEvent *event);
    //事件拦截
    bool eventFilter(QObject *watched, QEvent *event) override;
    //计算音量大小
    void computeVolume();

signals:
    void silenceBtnSignal(bool);
    void setMusicVolume(int);

private slots:
    //静音按钮点击处理
    void on_silenceBtn_clicked();

private:
    Ui::VolumeTool *ui;
    bool silence_flag;
    int volum;
};

#endif // VOLUMETOOL_H
